package com.paipai.config;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import com.paipai.loginInterceptor.LoginInterceptor;

@Configuration
public class InterceptorConfig  extends WebMvcConfigurerAdapter{
	
	
	@Autowired
	private LoginInterceptor  loginInterceptor ; 
	
	
	
	
	/**
	 * 配置拦截器
	 */
	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		//将拦截器放入
		InterceptorRegistration registration = registry.addInterceptor(loginInterceptor);
		//设置需要被拦截的目录
		InterceptorRegistration addPathPatterns = registration.addPathPatterns("/cart/**");
		//设置放行的目录
		//addPathPatterns.excludePathPatterns("/**");
		super.addInterceptors(registry);
	}
	
	
	
	
	



	
	

}
